/* jshint esversion: 6 */
import { createApp } from "vue";
import App from "./App.vue";
import ElementUI from "element-plus";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/index.css";
import router from "@/router/index.js";
import "element-plus/theme-chalk/display.css";
import "bootstrap-icons/font/bootstrap-icons.css";

import axios from "axios";

import VueMarkdownEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";

import Prism from "prismjs";
// html预览
// import VMdPreviewHtml from "@kangc/v-md-editor/lib/preview-html";
// import "@kangc/v-md-editor/lib/style/preview-html.css";
//
// import hljs from "highlight.js";
import VMdPreview from "@kangc/v-md-editor/lib/preview";
import "@kangc/v-md-editor/lib/style/preview.css";
// import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
import "@kangc/v-md-editor/lib/theme/style/github.css";

// todolist
import createTodoListPlugin from "@kangc/v-md-editor/lib/plugins/todo-list/index";
import "@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css";

//emoji
import createEmojiPlugin from "@kangc/v-md-editor/lib/plugins/emoji/index";
import "@kangc/v-md-editor/lib/plugins/emoji/emoji.css";
// katex
import createKatexPlugin from "@kangc/v-md-editor/lib/plugins/katex/cdn";
//Mermaid
import createMermaidPlugin from "@kangc/v-md-editor/lib/plugins/mermaid/cdn";
import "@kangc/v-md-editor/lib/plugins/mermaid/mermaid.css";
//代码行号
import createLineNumbertPlugin from "@kangc/v-md-editor/lib/plugins/line-number/index";
//高亮代码行
import createHighlightLinesPlugin from "@kangc/v-md-editor/lib/plugins/highlight-lines/index";
import "@kangc/v-md-editor/lib/plugins/highlight-lines/highlight-lines.css";
import background from "@/util/ribbons.js";
import "../node_modules/font-awesome/css/font-awesome.css";
//预览器
VMdPreview.use(vuepressTheme, {
  Prism,
  codeHighlightExtensionMap: {
    vue: "xml",
  },
})
  .use(
    createTodoListPlugin({
      color: "#409EFF",
    })
  )
  .use(createEmojiPlugin())
  .use(createKatexPlugin())
  .use(createMermaidPlugin())
  .use(createLineNumbertPlugin())
  .use(createHighlightLinesPlugin());

//编辑器
VueMarkdownEditor.use(vuepressTheme, {
  Prism,
  codeHighlightExtensionMap: {
    vue: "xml",
  },
})
  .use(
    createTodoListPlugin({
      color: "#409EFF",
    })
  )
  .use(createEmojiPlugin())
  .use(createKatexPlugin())
  .use(createMermaidPlugin())
  .use(createLineNumbertPlugin())
  .use(createHighlightLinesPlugin());

axios.defaults.baseURL = "http://10.10.110.99:8080/";

const app = createApp(App);

app.use(ElementUI);
app.use(router);
app.use(VueMarkdownEditor);
app.config.globalProperties.$http = axios;
app.provide("$http", axios);

app.use(background);
app.use(VMdPreview);
app.mount("#app");
